﻿/*
 * author:				可乐加糖
 * email:				black.angel.liu@gmail.com
 * description:		命名空间定义函数
 */

var MYAPP = MYAPP || {}
MYAPP.namespace = function(nt_string){
	var parts = nt_string.split("."),
	parent = MYAPP, i ;
	if(parts[0] === "MYAPP"){
		parts = parts.slice(1);//把数组中的数据项移除数组
	}
	for(i=0;i<parts.length;i+=1){
		if(typeof parent[parts[i] === 'undefined']){
			parent[parts[i]] = {};
		}
		parent = parent[parts[i]];
	}
	return parent;
}